import request from '@/utils/request'

// 查询预约
// 列表
export function listInfo(query) {
  return request({
    url: '/appointment/info/list',
    method: 'get',
    params: query
  })
}

// 查询预约
// 详细
export function getInfo(id) {
  return request({
    url: '/appointment/info/' + id,
    method: 'get'
  })
}

// 新增预约

export function addInfo(data) {
  return request({
    url: '/appointment/info',
    method: 'post',
    data: data
  })
}

// 修改预约

export function updateInfo(data) {
  return request({
    url: '/appointment/info',
    method: 'put',
    data: data
  })
}

//已到店

export function arrivalInfo(id) {
  return request({
    url: '/appointment/info/arrival/' + id,
    method: 'put',
  })
}

// 取消预约

export function cancelInfo(id) {
  return request({
    url: '/appointment/info/cancel/' + id,
    method: 'put'
  })
}

// 删除预约

export function delInfo(id) {
  return request({
    url: '/appointment/info/' + id,
    method: 'delete'
  })
}

//预约生成结算单
export function createStatement(id) {
  return request({
    url: `/appointment/info/${id}/statements`,
    method: 'put'
  })
}



